package org.jackysoft.service;

import java.util.Collection;

import org.apache.lucene.queryparser.classic.ParseException;
import org.jackysoft.data.ServiceProvider;
import org.jackysoft.entity.Department;
import org.jackysoft.entity.User;
import org.jackysoft.entity.nosql.UserInfo;
import org.jackysoft.util.Page;
import org.jackysoft.util.VariableType;
import org.springframework.dao.DataAccessException;

public interface UserService extends ServiceProvider<User>{

	User getLoginInfo(String name) throws DataAccessException;

	UserInfo getUserInfo(String name) throws DataAccessException;

	void marked4Remove(User owner) throws DataAccessException;	

	Collection<User> sameDepartment() throws DataAccessException;
	
	
	Collection<User> findAllByDepartments(Collection<Department> depts)	throws DataAccessException;

	
	Collection<User> getsUsers(String idz, char secapchar, VariableType vt)throws DataAccessException;
	Collection<User> getsUsers(Iterable<String> idz,VariableType vt)throws DataAccessException;

	Page findByDepartment(String dept, int page, int size) throws DataAccessException;

	Page findByRole(String role, int page, int size) throws DataAccessException;
	
	Page findBySecurityRole(String srole, int page, int size) throws DataAccessException;

	void reset(String dept) throws DataAccessException;

	void saveProfile(User user) throws DataAccessException;

		
	void removeAuthority(String user,String auth);
	void removeDepartment(String user);
	void removeRole(String user);
	
	
	/**
	 * 返回jstree 的搜索路径
	 * 
	 * @throws ParseException
	 * */
	Collection<User> searchs(final String searchString)
			throws DataAccessException, ParseException;

	void pass(Collection<String> beans) throws DataAccessException;

	boolean exists(String username) throws DataAccessException;

	Collection<User> findByDepartment(String id);

}
